<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>数据库操作</title>
</head>
<body>
<h1>命令执行结果</h1>
<pre><?php
    $sqls=$_POST['sql']; //获取要执行的语句
    $sqlArray=preg_split('@\s*;\s*@',$sqls,flags:PREG_SPLIT_NO_EMPTY); //sql语句数组
    var_dump($sqlArray);
    ?>
</pre>
<hr>
<div class='sql'>use db</div>
<div class='result'>受影响的行数：0</div>
<div class='sql'>show tables</div>
<table><tr><th>序号</th><th>Tables_in_db</th></tr><tr><td>1</td><td>chengyu</td></tr><tr><td>2</td><td>students</td></tr></table>
<div class='sql'>insert into chengyu
    values ('哈哈哈','哈'),('嘻嘻嘻','嘻')</div>
<div class='result'>受影响的行数：2</div>
</body>
</html>
